This invention relates generally to mirrored databases used for online transaction processing (OLTP), and more particularly to the resynchronization of bulk load and append-only tables on a mirrored database.
Enterprises employ database systems comprising mirrored databases as a repository of the enterprise's stored data, and to support operational systems such as online transaction processing (OLTP). The databases generally have large sizes, store large volumes of data in tables, and experience high numbers of online transactions.
Mirrored databases comprise a primary database and a mirror database pair that are synchronized by redundantly writing the same data to both databases for backup and to assure high availability of the data if one of the databases fails (crashes). In the event of a crash, or loss of communications with a database, a mirror resynchronization process must be performed by the system to catch up lost changes on the mirror and new changes resulting from new online transactions while the mirror was down in order to restore the databases to a synchronized state. An important measure of database service availability is the time it takes for a mirror database to take over processing once a failure of the primary database has been detected. This time is referred to as the mean-time-to-repair (MTTR). Accordingly, it is important that resynchronization be performed timely so that the database has a very good repair-time and high-availability.
For large database transaction loads it is common for performance reasons to bypass the standard transaction log, also known as the Write-Ahead-Log (WAL), and bulk load (write) transaction-related changes directly to target database files. Bulk load tables are fixed length page tables that are created and loaded in one command. At the end of the command, the table files are flushed to disk. When the mirror database is synchronized, then the files are flushed to both the primary and mirrored disks. The advantage of bypassing the WAL is that a shared memory database page cache in which data is written before writing it to the WAL is not polluted with new pages, and the data is not written twice, i.e., once to the transaction log and a second time to the database file by a background writer.
Bulk loading of tables to database files in the presence of ongoing online transactions creates problems as to how to do mirror resynchronization timely for mirrored databases. Conventionally, mirror resynchronization has to wait until an in-progress bulk load transaction finishes in order to resynchronize that data. Thus, mirror resynchronization can be unduly delayed by the duration of very long bulk load transactions. Further, if there are overlapping bulk load transactions, mirror resynchronization could be delayed for a very long time. Finishing mirror-resynchronize in a timely manner is very important so that the database has very good repair-time and high-availability. Therefore, bulk loading can adversely affect high availability.
It is desirable to provide systems and methods that address these and other problems of timely resynchronization of mirrored databases while writing data directly to database files, as in bulk load and append-only tables, and accommodating changes due to new online transactions to afford good repair time and high availability, and it is to these ends that the present invention is directed.